<Page
    x:Class="AppStudio.Views.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:AppStudio.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="0"/>
      <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <Grid.ChildrenTransitions>
      <TransitionCollection>
        <EntranceThemeTransition/>
      </TransitionCollection>
    </Grid.ChildrenTransitions>
    <Hub x:Name="Container" Grid.Row="1" Background="{StaticResource AppBackground}" DataContext="{Binding}" HeaderTemplate="{StaticResource PageHeader}" SectionsInViewChanged="OnSectionsInViewChanged">
      <HubSection HeaderTemplate="{StaticResource HubHeader}" Width="360" Header="Der BDVB" DataContext="{Binding MainViewModel.DerBDVBModel}" ContentTemplate="{StaticResource DerBDVBList}" IsHeaderInteractive="{Binding HasMoreItems}" />
      <HubSection HeaderTemplate="{StaticResource HubHeader}" Width="360" Header="Gliederungen" DataContext="{Binding MainViewModel.GliederungenModel}" ContentTemplate="{StaticResource GliederungenList}" IsHeaderInteractive="{Binding HasMoreItems}" />
      <HubSection HeaderTemplate="{StaticResource HubHeader}" Width="360" Header="Facebook" DataContext="{Binding MainViewModel.FacebookModel}" ContentTemplate="{StaticResource FacebookList}" IsHeaderInteractive="{Binding HasMoreItems}" />
      <HubSection HeaderTemplate="{StaticResource HubHeader}" Width="360" Header="Kontakt" DataContext="{Binding MainViewModel.KontaktModel}" ContentTemplate="{StaticResource KontaktList}" IsHeaderInteractive="{Binding HasMoreItems}" />
      <HubSection HeaderTemplate="{StaticResource HubHeader}" Width="360" Header="About" DataContext="{Binding MainViewModel.AboutModel}" ContentTemplate="{StaticResource AboutList}" IsHeaderInteractive="{Binding HasMoreItems}" />
    </Hub>
  </Grid>

  <Page.BottomAppBar>
    <CommandBar Visibility="{Binding MainViewModel.AppBarVisibility}" ClosedDisplayMode="Minimal" Background="{StaticResource AppBarBackground}">
      <AppBarButton x:Uid="TextToSpeechButton" Visibility="{Binding MainViewModel.SelectedItem.TextToSpeechVisibility}"
                    Command="{Binding MainViewModel.SelectedItem.TextToSpeechCommand}">
        <AppBarButton.Icon>
          <BitmapIcon UriSource="ms-appx:///Assets/AppBar/TextToSpeech.png"/>
        </AppBarButton.Icon>
      </AppBarButton>
      <AppBarButton x:Uid="RefreshButton" Visibility="{Binding MainViewModel.SelectedItem.RefreshVisibility}"
                    Command="{Binding MainViewModel.SelectedItem.RefreshCommand}">
        <AppBarButton.Icon>
          <BitmapIcon UriSource="ms-appx:///Assets/AppBar/Refresh.png"/>
        </AppBarButton.Icon>
      </AppBarButton>
      <CommandBar.SecondaryCommands>
        <AppBarButton x:Uid="AboutButton" Label="about" Command="{Binding MainViewModel.AboutCommand}"/>
        <AppBarButton x:Uid="PrivacyButton" Label="privacy" Command="{Binding MainViewModel.PrivacyCommand}"/>
        <AppBarButton x:Uid="ShareItemButton" Label="share item" Visibility="{Binding MainViewModel.SelectedItem.ShareItemVisibility}" Command="{Binding MainViewModel.SelectedItem.ShareItemCommand}"/>
      </CommandBar.SecondaryCommands>
    </CommandBar>
  </Page.BottomAppBar>
</Page>
